//
//  YTTTabBar.m
//  跑圈儿
//
//  Created by 唐康 on 16/4/19.
//  Copyright © 2016年 唐康. All rights reserved.
//

#import "YTTTabBar.h"
#import "YTTRunmapController.h"
#import "YTTNavigationController.h"
@interface YTTTabBar ()
/**< 跑步地图按钮  */
@property(nonatomic, strong)UIButton *runMapBtn;
@end
@implementation YTTTabBar

//- (instancetype)initWithFrame:(CGRect)frame
//{
//    self = [super initWithFrame:frame];
//    if (self) {
//        self.backgroundImage = [UIImage imageNamed:@"tabbar-light"];
//        UIButton *runMapBtn = [UIButton buttonWithType:(UIButtonTypeCustom)];
//        [runMapBtn setBackgroundImage:[UIImage imageNamed:@"run_map"] forState:(UIControlStateNormal)];
//        [runMapBtn setBackgroundImage:[UIImage imageNamed:@"run_map_click"] forState:(UIControlStateHighlighted)];
//        //监听runmap 按钮
//        [runMapBtn addTarget:self action:@selector(showMap) forControlEvents:(UIControlEventTouchUpInside)];
//        [self addSubview:runMapBtn];
//        self.runMapBtn = runMapBtn;
//
//    }
//    return self;
//}
//runmap按钮点击方法
//- (void)showMap{
//    YTTLog(@"加载地图");
//    YTTRunmapController *runMapVC = [[YTTRunmapController alloc]init];
//    YTTNavigationController *navi = [[YTTNavigationController alloc]initWithRootViewController:runMapVC];
//    [[UIApplication sharedApplication].keyWindow.rootViewController presentViewController:navi animated:NO completion:nil];
//    
//}
////按钮布局
//-(void)layoutSubviews{
//    [super layoutSubviews];
//    CGFloat width = self.width;
//    CGFloat height = self.height;
//    //设置发布按钮frame
//    self.runMapBtn.size = self.runMapBtn.currentBackgroundImage.size;
//    self.runMapBtn.center = CGPointMake(width * 0.5, height * 0.5);
//    CGFloat buttonY = 0;
//    CGFloat buttonW = width / 5;
//    CGFloat buttonH = height;
//    NSInteger index = 0;
//    for (UIView *button in self.subviews) {
//        if (![button isKindOfClass:[UIControl class]] || button == self.runMapBtn) continue;
//        CGFloat buttonX = buttonW *((index > 1)?(index + 1):index);
//        button.frame = CGRectMake(buttonX, buttonY, buttonW, buttonH);
//        //增加索引
//        index ++;
//    }
//}


@end
